#pragma once

#include <vector>
#include <string>

#include "actuator_msgs/actuator_msg.h"
#include "control_msgs/control_msg.h"
#include "control_msgs/control_state_msg.h"
#include "task_msgs/task_msg.h"
#include "amr_trajectory_msgs/amr_trajectory_msg.h"

#include "localization_msgs/localization_msg.h"

namespace control
{
    enum FsmState
	{
		Finish,
		Work,
		Pause,
		Fail,
		Other //不允许这种状态
	};

	enum RunningType
	{
		HEADFOLLOWING = 0,
		ROTATING,
		STEERTURNING
	};
	enum Event_e
	{
		normal,
		low_power,
		location_failure,
		network_failure,
		emc_stop
	};
	struct TargetState
	{
		std::string target_point_id;
		std::string target_path_id;
		geometry_msgs::Pose target_point_pose;
		bool is_receive_cmd;
		uint32_t move_task_id;
	};

    struct AMRState
    {
        actuator_msgs::actuator_msg actuator;
		control_msgs::control_state_msg control_state;
        amr_trajectory_msgs::amr_trajectory_msg msg_trajectory_task;
        amr_trajectory_msgs::amr_trajectory_msg msg_trajectory_loc;
		localization_msgs::localization_msg amr_local_;

		TargetState target_state;

        Event_e event;
        float lat_error;
		float heading_error;
        RunningType running_type;
		uint32_t min_index;
        AMRState()
        {
            event = Event_e::normal;
            lat_error = 0.0f;
            heading_error = 0.0f;
            running_type = RunningType::HEADFOLLOWING;
			min_index = 0;

			control_state.cur_path_id = "";
			control_state.cur_point_id = "";
        }
    };
}